While processing a data stream, typically, it is required to validate, update or filter a record in the data stream based on a subset of data components associated with the record, or initiate an action depending on value of a data component associated with a record, or increment a statistic counters for a valid record. Each record is generally passed through a number of pre-configured rules which are executed when a data stream is processed. There are many types of rules, e.g. one type of rule just contains a set of fields and the corresponding values. Both the fields and the corresponding values are data components of the rule.
In case of processing a high volume data stream with many pre-configured rules, rule execution time is of high importance from throughput perspective. Before a rule is executed, the data components related to the rule have to be extracted from a computer word so that the rule can be subsequently executed.
One existing method for extracting data components related to the rule from a computer word is a simple scan method. This is a simple and compact method. However, this method needs to scan each of a plurality of bits in a rule representation associated with the rule from the computer word regardless of the number of data components related to the rule. That is to say, this method performs same number of loops for extracting data components related to any rule. Therefore, this method is inefficient when there are only a few data components related to the rule to be extracted from the computer word.
Another existing method for extracting data components related to the rule is a rightmost bit extraction method. This method is efficient when there are only a few data components related to the rule in the computer word since it executes a specific number of computer instructions for each data component. However, this method is inefficient when there are many data components related to the rule in a computer word.